#include"main.h"
#include"ligth_sensor.h"

#include"adc.h"

uint32_t Light_Sensor_Get(void)
{
	//均值滤波
	uint32_t data = 0, i;
	
	for(i = 0; i < 100; i++)
	{
		HAL_ADC_Start(&hadc1);
		HAL_ADC_PollForConversion(&hadc1, 100);
		data += HAL_ADC_GetValue(&hadc1);
	}
	
	data /= 100;
	return data;
	
}
